//package com.xiemulei.gulimall.search.api;
//
//import com.xiemulei.common.utils.R;
//import com.xiemulei.gulimall.search.service.MallSearchService;
//import com.xiemulei.gulimall.search.vo.SearchParam;
//import com.xiemulei.gulimall.search.vo.SearchResult;
//import jakarta.servlet.http.HttpServletRequest;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import jakarta.annotation.Resource;
//
//@RestController
//public class SearchApi {
//    @Resource
//    MallSearchService mallSearchService;
//
//    @GetMapping("/search")
//    public R search(SearchParam param, HttpServletRequest request) {
//        String queryString = request.getQueryString();
//        param.set_queryString(queryString);
//        // 根据查询参数，去 es 中检索商品
//        SearchResult result = mallSearchService.search(param);
//        return R.ok().put("data", result);
//    }
//}
